Fix SSSOM structural mapping column names for sssom-py compatibility#144
Merged
realmarcin merged 3 commits intomainfrom Apr 25, 2026
Merged
Fix SSSOM structural mapping column names for sssom-py compatibility#144realmarcin merged 3 commits intomainfrom
realmarcin merged 3 commits intomainfrom
Conversation
Rename subject_type → d4d_subject_range and object_type → rocrate_value_type to avoid colliding with reserved SSSOM columns that expect EntityTypeEnum values. Add fallback in SSSOMIntegration when sssom-py silently drops rows. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adjusts the structural SSSOM mapping output to avoid reserved SSSOM column names (subject_type, object_type) so sssom-py no longer silently drops all rows, and adds a safety fallback to the custom reader when sssom-py yields an empty mapping set.
Changes:
- Renamed structural mapping extension columns to
d4d_subject_rangeandrocrate_value_typeand updated the generator output accordingly. - Regenerated
data/mappings/d4d_rocrate_structural_mapping.sssom.tsvwith the new header. - Added a fallback path in
SSSOMIntegrationwhensssom-pyparses to 0 mappings.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/fairscape_integration/utils/sssom_integration.py |
Adds “0 rows” detection and fallback to the custom TSV reader when sssom-py silently drops all mappings. |
src/alignment/generate_structural_mapping.py |
Renames non-standard structural columns to non-reserved names for sssom-py compatibility. |
data/mappings/d4d_rocrate_structural_mapping.sssom.tsv |
Updates TSV header (and regenerated content) to match the new column names. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…l getter - Emit RuntimeWarning when sssom-py returns 0 rows so the silent fallback to the custom reader is visible even when verbose=False - Add SSSOMIntegration.get_active_implementation() instance method that reflects per-instance state (self.use_standard), so callers can tell which reader an instance is actually using after a runtime fallback - Clarify get_implementation() docstring: it reports the default selection based on package availability, not per-instance state Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The empty-mappings fallback from this PR's first commit (2624ee2) was also merged into main via PR #143, leaving only the Copilot-review follow-up (warnings.warn + get_active_implementation) as unique to this branch. Conflict resolved by keeping the warnings.warn block alongside the already-on-main fallback logic. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
subject_type→d4d_subject_rangeandobject_type→rocrate_value_typein the structural mapping generator and regenerated the TSVSSSOMIntegrationwhensssom-pyreturns 0 rows after silent dropsContext
subject_typeandobject_typeare reserved SSSOM columns expectingEntityTypeEnumvalues (owl class,rdf property, etc.). The structural mapping was using these columns to store LinkML range names and Python types instead, which causedsssom-pyto silently reject all 149 rows. This resulted in thetest_load_structural_mappingCI failure.The column data is preserved under non-reserved names. No mapping content was changed.
Test plan
sssom-pyparses all 149 rows from the regenerated TSVtest_load_structural_mappingpasses withsssom-pyinstalled🤖 Generated with Claude Code